this._actionGroupNotifyId = 0;
let bin = new St.Bin({ name: 'appMenu' });
+ bin.connect('style-changed', Lang.bind(this, this._onStyleChanged));
this.actor.add_actor(bin);
this.actor.bind_property("reactive", this.actor, "can-focus", 0);
this._stop = true;
- let spinnerIcon = global.datadir + '/theme/process-working.svg';
- this._spinner = new AnimatedIcon(spinnerIcon, PANEL_ICON_SIZE);
- this._container.add_actor(this._spinner.actor);
- this._spinner.actor.hide();
- this._spinner.actor.lower_bottom();
+ this._spinner = null;
let tracker = Shell.WindowTracker.get_default();
let appSys = Shell.AppSystem.get_default();
onCompleteScope: this });
},
+ _onStyleChanged: function(actor) {
+ let node = actor.get_theme_node();
+ let [success, icon] = node.lookup_url('spinner-image', false);
+ if (!success || this._spinnerIcon == icon)
+ return;
+ this._spinnerIcon = icon;
+ this._spinner = new AnimatedIcon(this._spinnerIcon, PANEL_ICON_SIZE);
+ this._container.add_actor(this._spinner.actor);
+ this._spinner.actor.hide();
+ this._spinner.actor.lower_bottom();
+ },
+
_onIconBoxStyleChanged: function() {
let node = this._iconBox.get_theme_node();
this._iconBottomClip = node.get_length('app-icon-bottom-clip');
this._stop = true;
this.actor.reactive = true;
+
+ if (this._spinner == null)
+ return;
+
Tweener.addTween(this._spinner.actor,
{ opacity: 0,
time: SPINNER_ANIMATION_TIME,
startAnimation: function() {
this._stop = false;
this.actor.reactive = false;
+
+ if (this._spinner == null)
+ return;
+
this._spinner.play();
this._spinner.actor.show();
},
}
this._label.actor.allocate(childBox, flags);
+ if (this._spinner == null)
+ return;
+
if (direction == Clutter.TextDirection.LTR) {
childBox.x1 = Math.floor(iconWidth / 2) + this._label.actor.width;
childBox.x2 = childBox.x1 + this._spinner.actor.width;
return;
}
- this._spinner.actor.hide();
+ if (this._spinner)
+ this._spinner.actor.hide();
if (this._iconBox.child != null)
this._iconBox.child.destroy();
this._iconBox.hide();